<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>注册页面</title>
<script type="text/javascript" src="Content/script/jquery-1.10.2.js"></script>
<script type="text/javascript" src="Content/script/jquery.validate.js"></script>
<script type="text/javascript">
	$(function(){
		$("#form").validate({
			rules:{
				username:{
					required:true},
				password:{
					required:true},
				confirmPassword:{
					required:true,
					equalTo:"#inputPassword3"
				},
				nickname:{
					required:true
				},
				email:{
					required:true,
					email:true
				}
			},
			messages:{
				username:{
					required:"请输入用户名"},
				password:{
					required:"请输入密码"
					},
				confirmPassword:{
					required:"请再次输入密码",
					equalTo:"两次输入密码须一致"
				},
				nickname:{
					required:"请输入昵称"
				},
				email:{
					required:"请输入邮箱地址",
					email:"邮箱地址不正确"
				}
				}
		});	

	});
</script>
    <style>
        label.error{color:red}
    </style>
    <!-- Bootstrap -->
    <link href="Content/bootstrap/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<%@ include file="/shared/header.jsp"  %>
    <div id="path">
        <ol class="breadcrumb">
            <li><a href="IndexServlet">首页</a></li>
            <li><a href="login.jsp">登录</a></li>
        </ol>
    </div>
    <div id="content">
        <div class="col-md-6">
            <form class="form-horizontal" action="RegisterServlet" method="post" id="form">
                <div class="form-group">
                    <label for="inputUserName3" class="col-sm-2 control-label">用户名</label>
                    <div class="col-sm-10">
                    	<input type="hidden" value="${user }" id="user"/>
                        <input type="text" class="form-control" name="username" id="inputUserName3" placeholder="用户名">&nbsp;&nbsp;<label class="error">${error }</label>
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputPassword3" class="col-sm-2 control-label">密码</label>
                    <div class="col-sm-10">
                        <input type="password" class="form-control" name="password" id="inputPassword3" placeholder="密码">
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputConfirmPassword3" class="col-sm-2 control-label">密码确认</label>
                    <div class="col-sm-10">
                        <input type="password" class="form-control" name="confirmPassword" id="inputConfirmPassword3" placeholder="密码确认">
                    </div>
                </div>
                <div class="form-group">
                    <label  class="col-sm-2 control-label">昵称</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" name="nickname" placeholder="昵称">
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-2 control-label">邮箱</label>
                    <div class="col-sm-10">
                        <input type="email" class="form-control" name="email" id="inputEmail3" placeholder="邮箱">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-default">注册</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
        <%@ include file="/shared/footer.jsp" %>
</div>

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="Content/bootstrap/js/bootstrap.min.js"></script>
</body>
</html>